export default {
	// 时间日期格式化
	datetimeFormatFilter(datetime, type) {
		const date = new Date(datetime)
		const year = date.getFullYear()
		const month = date.getMonth() + 1
		const day = date.getDate()
		const hour = date.getHours()
		const minute = date.getMinutes()
		const second = date.getSeconds()
		const check = val => val > 9 ? val : `0${val}`
		let result = ''
		switch (type) {
			case 'no-year':
				result = [
					[check(month), check(day)].join('-'), [check(hour), check(minute)].join(':')
				].join(' ')
				break

			case 'no-time':
				result = [check(year), check(month), check(day)].join('-')
				break
		}
		return result
	}
}
